'''入门案例 '''
# 1.导入包
from selenium import  webdriver

# 2.创建浏览器对象
path = 'D:\\yfxdeve\\python\\Python39\\chromedriver.exe'
browser = webdriver.Chrome(path)

# 3.访问网站
url = 'https://www.baidu.com'
browser.get(url)

# 获取访问网站源码
content = browser.page_source
print(content)

# str1 = browser.capabilities['browserVersion']    #查看chrome版本
# str2 = browser.capabilities['chrome']['chromedriverVersion'].split(' ')[0]   #查看python下的chromedriver版本
# print(str1)
# print(str2)

# from selenium.webdriver.chrome.service import Service
# s = Service(path)
# browser = webdriver.Chrome(service=s)
